{{define "base/search_form"}}

<form class="layui-form admin-search-form" id="search_form" onsubmit="javascript:return false;">
    <ul class="layui-form-item">
        {{if .ModelPage.SearchPage}}
        {{range $key, $fieldName := .ModelPage.SearchPage.Items}}
        {{$field := index $.ModelPage.SearchPage.Fields $fieldName}}
        <li class="layui-inline">
            <label class="layui-form-label">{{$field.Title}}</label>
            <span class="layui-input-inline">{{$field.WidgetHtml | Html}}</span>
        </li>
        {{end}}{{end}}
        <li class="layui-inline">
            <button class="layui-btn layui-btn-sm" admin-href="layui.fulltable.search();" link-type="1" id="search_button">查询</button>
        </li>
    </ul>
</form>
<script type="text/javascript">
    layui.use(['admin'],function() {
        layui.admin.global.searchFormId = "search_form"; //查询表单id
        layui.admin.renderDate('#search_form');
        layui.admin.renderXmSelect('#search_form');
        layui.form.render(null, 'search_form');
    });
</script>
{{end}}